home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc1 / maprz2_e.lha / MapRZ2_EVD1_1 / MapRZ2.doc < prev   
Text File  |  1996-05-06  |  11KB  |  300 lines

  1. MapRZ2 V1.1
  2. RetinaZ2mapped V1.1
  3. RetinaZ2mappedRE V1.1
  4.  
  5. by Christoph Niedeggen 1995-1996
  6.  
  7.  
  8. Index
  9.  
  10. 1. Disclaimer
  11. 2. Purpose
  12. 3. Files in the archive
  13. 4. Getting started
  14. 5. Principle of MapRZ2
  15. 6. Possible Improvements
  16. 7. Known Bugs
  17. 8. Configuration used by me
  18. 9. How to contact me
  19. 10. Thanks to
  20.  
  21. Appendix A: Used Memory Map
  22. Appendix B: MMU address translation settings (68851, 68030)
  23.  
  24.  
  25.  
  26.  
  27. 1. Disclaimer
  28.  
  29. MapRZ2, RetinaZ2mapped and RetinaZ2mappedRE are in the public domain.  Use this
  30. software at your own risk.  In no event will the author, Christoph Niedeggen, be
  31. liable for any direct, indirect, or consequential damages resulting out of the
  32. use of or inability to use this software.
  33.  
  34. The program is not in a finished state since I had to stop the development in
  35. January and cannot continue until about July/August 1996 (I am currently
  36. studying in England and my Amiga is still in Germany.)
  37.  
  38. However, I think it might be useful for some people in its current state and
  39. probably someone already wants to continue the development.  Improvements of the
  40. program for non-commercial purposes are welcome.  Please contact me if you plan
  41. to do so.  Without being able to use my Amiga I am not able to answer all
  42. potential questions, but please feel free to send me comments and suggestions
  43. about MapRZ2.
  44.  
  45.  
  46.  
  47.  
  48. 2. Purpose
  49.  
  50. The Retina Z2 hardware only supports segmented access to the display memory via
  51. a 64k window.  Normally this is not a problem because the Retina hardware is
  52. accessed by 'retina.library', but some programs benefit from direct access to
  53. the display memory.
  54.  
  55. MapRZ2 uses an MMU (currently 68851 or 68030) to map the segmented RetinaZ2
  56. memory to a linear chunk in the virtual memory space.
  57.  
  58. RetinaZ2mapped and RetinaZ2mappedRE (RE = RetinaEmu) are external video drivers
  59. for ShapeShifter which take advantage of MapRZ2.  Because the display does not
  60. have to be refreshed anymore (currently just in 256 colour mode), the emulation
  61. becomes much quicker - the access speed to the display memory is now just
  62. limited by the Retina hardware.  Another big advantage is that no display buffer
  63. in Fast RAM is necessary, thus leaving more memory for the emulation.
  64.  
  65. Because MapRZ2 is a program on its own, the linear display memory could be used
  66. for other programs as well, e.g.  it might be possible to write a RetinaZ2
  67. driver for the CyberGraphics system.  Up to now the segmented mode has prevented
  68. to write such a driver.
  69.  
  70.  
  71.  
  72.  
  73. 3. Files in the archive
  74.  
  75. Source/make                    batchfile to generate executables with PhxAss
  76. Source/MapRZ2.asm              source code for MapRZ2
  77. Source/RetinaZ2mapped.asm      source code for SS EVD driver
  78. Source/RetinaZ2mappedRE.asm    source code for SS EVD driver
  79. VGADOC/clock.txt               information about various clock circuits
  80. VGADOC/intro.txt               some information about VGA programming on PCs
  81. VGADOC/ncr.txt                 information about special NCR VGA registers
  82. VGADOC/ramdac.txt              information about various RAMDACs
  83. VGADOC/readme.txt              main readme of VGADOC v4
  84. VGADOC/vgaregs.txt             information about general VGA registers
  85. Video_Drivers/RetinaZ2mapped   SS EVD driver, works without RetinaEmu
  86. Video_Drivers/RetinaZ2mappedRE SS EVD driver, needs RetinaEmu to be running
  87. MapRZ2                         main program
  88. MapRZ2.doc                     this documentation
  89.  
  90.  
  91.  
  92.  
  93. 4. Getting started
  94.  
  95. - Copy the two files in 'Video_Drivers' to the 'Video Drivers' directory of
  96. ShapeShifter.
  97.  
  98. - Turn FastROM off.  Otherwise you lose 512 kBytes of memory since this is not
  99. handled by MapRZ2 yet.
  100.  
  101. - Run the program MapRZ2.  After that it's possible to access the Retina display
  102. memory at $01c00000 - $01ffffff.
  103.  
  104. - Start ShapeShifter.
  105.  
  106. - Select one of the new drivers.  The 'RE' version needs RetinaEmu to be
  107. running, the other one runs without it and therefore saves some memory.
  108.  
  109. - Select 8 bit and enter the desired screen resolution.
  110.  
  111. - Set refresh rate to 10.  The refresh is just used to set the pointer to the
  112. Bus Error Handler at $8 to the Handler of MapRZ2 after the Mac OS has altered it
  113. and before the Video RAM is accessed.  It might be useful to chose a different
  114. rate for different processors (10 works fine on a 68030 with 25 MHz.)
  115.  
  116.  
  117.  
  118.  
  119. 5. Principle of MapRZ2
  120.  
  121. The MMU is used to treat the 64k Retina memory window (RMW) and the virtual
  122. Retina memory (VRM) in a special way:
  123.  
  124. As long as the Retina is accessed the usual way, just the RMW is used.  In this
  125. case, programs access the RMW directly and the VRM is marked invalid for the MMU
  126. so that accesses to it can be detected.
  127.  
  128. Once the VRM is accessed, MapRZ2 switches to the linear Mode:  Important
  129. registers (see below) of the NRC VGA chip are saved, the VGA chip is set to a
  130. two 32k segments mode (see below), the RMW is marked invalid for the MMU and the
  131. accessed 32k page of VRM is set valid, pointing to one of the two 32k segments
  132. of the Retina.
  133.  
  134. 'Important' VGA registers are any registers which influence the way the 64k
  135. segment is accessed - at least all registers that are changed by
  136. 'retina.library' and RetinaEmu.  Since I did not have a documentation to the NCR
  137. VGA chip when I wrote MapRZ2, I found these registers by partially disassembling
  138. the Retina software.  Therefore other registers could be affected as well - even
  139. though I did not realise any misbehaviour with V1.0 of MapRZ2.
  140.  
  141. The VGA chip offers the possibility to split the 64k segment into two halves.
  142. To use two 32k segments instead of one 64k segment is very useful if display
  143. memory is copied from one location to another, which occurs e.g.  every time a
  144. window is moved.  Otherwise the 64k segment pointer would have to be changed for
  145. every single byte (or longword ;-)
  146.  
  147. If an invalid page is accessed in linear mode, the 'older' 32k segment is used:
  148. The according page is set invalid, the new page valid and the segment pointer to
  149. the equivalent location.
  150.  
  151. Finally, if the RMW is accessed again, both valid 32k pages of the VRM are set
  152. invalid, the saved VGA registers are restored and the RMW is marked valid,
  153. pointing to the Retina hardware.
  154.  
  155.  
  156.  
  157.  
  158. 6. Possible Improvements
  159.  
  160. - FastROM option with support of an already installed FastROM/KickROM
  161.  
  162. - Option to select the address where the linear Retina memory block is installed
  163. (probably with auto detect of free memory areas)
  164.  
  165. - Replacement of the 'pflusha' commands by the 'pflush' command (I did not have
  166. enough information about this)
  167.  
  168. - Support of other processors (68040, 68060)
  169.  
  170. - Option to uninstall MapRZ2
  171.  
  172. - Better support of the Bus Error Handler by ShapeShifter (to avoid the altered
  173. use of the Screen Refresh.)  Probably Christian Bauer could implement a new
  174. pointer to the Video Driver Interface that is called just once after the Mac OS
  175. has changed this pointer and before the video memory is accessed.  But even
  176. without this it might be possible to turn off the refresh (or to set the rate
  177. very slow) after it has successfully changed the pointer.
  178.  
  179. - Better names for the variables and constants related to the VGA chip
  180. (RETINA_REGNUM, RETINA_REGVAL, SEG_..., RetinaRegB, RetinaSeg...).  I chose them
  181. before I downloaded VGADOC, which explains the function of the different
  182. registers and suggests better names for them.
  183.  
  184. - Support of 4, 16 and 24 bit modes.  Usual refresh routines might be used as I
  185. doubt that other modes than the 8 bit mode are compatible to the NCR VGA chip.
  186.  
  187. - RetinaZ2 support for the CyberGraphics system.  CyberGraphics needs linear
  188. display memory and therefore it was not possible to write a driver for the
  189. RetinaZ2 yet.  Since MapRZ2 is a program on its own that allows linear access to
  190. the Retina memory, it now should be possible to provide such a driver.  In fact it
  191. should not differ too much from the RetinaZ3 driver, because the used NCR VGA
  192. chips are quite similar.
  193. Since this driver would just use the virtual 'linear mode', it would not be
  194. necessary to save registers of the VGA chip by the Bus Error handler and
  195. therefore this handler could be shorter and quicker.
  196.  
  197.  
  198.  
  199.  
  200. 7. Known Bugs
  201.  
  202. With the new display drivers, Macintosh debuggers like MacsBug don't work
  203. anymore.  I assume that the Bus Error Exception does not work together with
  204. other exceptions when the debugger is running.
  205.  
  206. Virtual Memory Systems may not work because they also use the Bus Error Handler.
  207. However, it might be possible to use several Bus Error Handlers in a quite
  208. system friendly way (they have to check if the faulty address affects them and
  209. call the next handler if not.)
  210.  
  211. The current version uses the memory area $01000000-$01ffffff which might not
  212. work together with some system configurations.
  213.  
  214. Soft Kickstarts don't work because MapRZ2 doesn't support FastROM yet.
  215.  
  216.  
  217.  
  218.  
  219. 8. Configuration used by me
  220.  
  221. A2000, OS 3.1, A2630 with 8 MBytes, RetinaZ2 with 4 MBytes and software V2.3,
  222. Evolution V3.0 harddrive
  223.  
  224.  
  225.  
  226.  
  227. 9. How to contact me
  228.  
  229. until (mid/end) June 1996
  230.  
  231.   Christoph Niedeggen
  232.   5 Stannington Avenue
  233.   Newcastle upon Tyne
  234.   NE6 5AA
  235.   England
  236.  
  237.   e-mail: C.W.Niedeggen@ncl.ac.uk
  238.  
  239. from July/August 1996
  240.  
  241.   Christoph Niedeggen
  242.   Jodokusstr. 1
  243.   D-53332 Bornheim
  244.   Germany
  245.  
  246.   e-mail: Eggen@genesis.informatik.rwth-aachen.de
  247.  
  248.  
  249.  
  250.  
  251. 10. Thanks to
  252.  
  253. Christian Bauer for ShapeShifter
  254. Frank Wille for PhxAss
  255. Martin Apel for ADis
  256. Finn Thøgersen for VGADOC (full version at <http://www.datashopper.dk/~finth/>)
  257. Juergen Wahlmann for beta testing and his help
  258. Christophe Labouisse for useful hints on Retina programming
  259. Escom for continuing the development of the Amiga
  260. Sting for his great music
  261.  
  262.  
  263.  
  264.  
  265. Appendix A: Used Memory Map
  266.  
  267. 00000000-001fffff     2M Chip RAM (no caching)
  268. 00200000-009fffff     8M Fast RAM
  269. 00a00000-00bbffff  1792K reserved
  270. 00bc0000-00bfffff   256K CIAs (no caching)
  271. 00c00000-00d7ffff  1536K Ranger RAM / reserved
  272. 00d80000-00dbffff   256K reserved
  273. 00dc0000-00dfffff   256K clock chip and Custom Chips (no caching)
  274. 00e00000-00e7ffff   512K reserved
  275. 00e80000-00efffff   512K AutoConfig area, including Retina hardware (no caching)
  276. 00f00000-00f7ffff   512K reserved
  277. 00f80000-00ffffff   512K ROM (write protected, might be mapped to FastRAM)
  278.  
  279. 01000000-0101ffff   128K mirrored Retina hardware for access by Bus Error Handler
  280. 01020000-0103ffff   128K reserved
  281. 01040000-01bfffff 12032K reserved
  282. 01c00000-01ffffff     4M linear Retina memory
  283.  
  284. 02000000-ffffffff  4064M mapped linearly
  285.  
  286.  
  287.  
  288.  
  289. Appendix B: MMU address translation settings (68851, 68030)
  290.  
  291. 31             15            0
  292. |             |            |
  293. aaaa aaaa bbbb bb cc c ooo oooo oooo oooo
  294. _________ _______ ____ __________________
  295.  A-FIELD  B-FIELD  C-F  Remaining Offset
  296.  
  297. page size at level C:  32 KBytes
  298. page size at level B: 256 KBytes
  299. page size at level A:  16 MBytes
  300.